﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Microsoft.Windows.Controls.Ribbon;
using CommonSense.UI.Shell.Interfaces;

namespace CommonSense.UI.Shell.Services
{
    public abstract class BaseModule<TRibbonDictionary> : IModule where TRibbonDictionary : ResourceDictionary
    {
        public IEnumerable<RibbonTab> GetRibbonTabs()
        {
            TRibbonDictionary ribbonDictionary = (TRibbonDictionary)Activator.CreateInstance(typeof(TRibbonDictionary));
            foreach (object key in ribbonDictionary.Keys)
            {
                RibbonTab ribbonTab = ribbonDictionary[key] as RibbonTab;
                if (ribbonTab != null)
                {
                    yield return ribbonTab;
                }
            }
        }

        public virtual ResourceDictionary GetModuleResouces()
        {
            return null;
        }

        public virtual void RegisterServices(IDIContainer diContainer)
        {
        }
    }
}
